package com.ieslab.powergrid.demosvr.controller;

import com.ieslab.powergrid.demosvr.entity.Person;
import com.ieslab.powergrid.demosvr.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/** <p>Title: PersonService </p>
 * <p>Description: 用户rest接口类，测试demo使用</p>
 *
 * @author houpeibin
 * @date 2020-2-20 下午7:15:30
 * @version V1.0
 */
@RestController
@RequestMapping("/person")
public class PersonController {
    @Autowired
    PersonService personService;
    /**
     * 获取所有用户
     * @return
     */
    @RequestMapping("/getPersons")
    public List<Person> getPersons(String id){
        Map map = new HashMap<>();
        map.put("id", id);
        return personService.getPersons(map);
    }

}
